{% extends "base.html" %}
{% block title %} {{entry.title}} - {{blog.title}} {% endblock %}
{% block head_block %}
{% if entry %}
{%if entry.strtags%}<meta name="Keywords" content="{{entry.strtags}}" />{%endif%}
{%if entry.excerpt%}<meta name="Description" content="{{entry.excerpt}}" />{%endif%}
{% if entry.allow_comment %}
<script type="text/javascript" src="/themes/{{ blog.theme_name }}/js/js_quicktags.js"></script>
<script type="text/javascript" src="/themes/{{ blog.theme_name }}/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.form.utf8.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
{% endif %}
{% endif %}
{% endblock %}

{% block content%}
{% if entry %}

<div class="post" id="post-{{entry.key}}">

    <fieldset>

        <legend class='title'>
        <span style='font-size: large;'>
            <a href="/{{ entry.link }}" rel="bookmark" title="Permanent Link to {{entry.title}}">{{entry.title}}</a>
            </span>
        </legend>

            <div class='capsule dateauthor'>
                {{entry.date|datetz:"F jS, Y"}} by {{blog.author}}
            </div>
        <div id='postaction' class='actbubble'>

            <ul>
            {%if self.is_admin%}
            <li><a href="{{entry.edit_url}}">Edit Entry</a>                           
                   </li>
                     {%endif%} 
                            <li> <a href='' title='{{entry.commentcount}} Comments and {{entry.readtimes}} Views'>{{entry.readtimes}} Views</a> </li>
                            {% if entry.allow_comment %}
                            <li> <a href='#respond' title='Go to the comment box'>Add Comment</a> </li>
                            {% else %}
                            <li> <a href=''>Comment Closed</a></li>
                            {% endif %}
                            <li> <a href='/{{ entry.link }}' rel='trackback'>Trackback</a> </li>
                            
            </ul>

        </div> <!-- end postaction -->

        <div class="entry">
        {{ entry.content }}

        </div>

        <br clear='all'/>

                <div class="postmetadata"
                    style='opacity: 0.4;'
                    onmouseover='this.style.opacity = 1.0;'
                    onmouseout='this.style.opacity = 0.4;'
                    >

                    <span class='capsule commentlink actbubble'><a href="/{{entry.link}}#comments">Comments({{entry.commentcount}})&#187;</a>
                    </span>
                    
                    <input type='button' class='capsule actbubble cattrigger'
                        value='Categories &darr;'
                        onclick='fadeBlock("postcats-{{entry.key}}");'/>
                        
                       <input type='button' class='capsule actbubble cattrigger'
                            value='Tags &darr;'
                            onclick='fadeBlock("posttags-{{entry.key}}");'/>
                        
                    

                    <!-- inline style for easy JavaScript mods, without getting computed styles -->
                    <div id='postcats-{{entry.key}}' class='postcattags postcats'
                        style='display: none; opacity: 0;'>
{%for cate in entry.categories%} <a href="/category/{{cate.slug}}">{{cate.name}}</a> {%endfor%}                    </div>

                    {% if entry.tags%}
                        <div id='posttags-{{entry.key}}' class='postcattags posttags'
                            style='display: none; opacity: 0;'>
                            {%for tag in entry.tags%}<a href="/tag/{{tag|urlencode}}">{{tag}}</a> 
                            {%endfor%}</div>
                    {%endif%}

                </div> <!-- postmetadata -->



    </fieldset>

</div>

{% else %}

<div class="post">
    <fieldset>
    <br/>
    <div class='entry'>
    <p>
    Sorry, no posts matched your criteria.
    </p>
    <br/>
    <br/>
    </div>
    </fieldset>
</div>

{%endif%}

{% include "comments.html" %}
{% endblock %}

